//
//  TroopEntity.m
//  SpaceViking
//
//  Created by gnt on 1/11/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "TroopEntity.h"

@implementation TroopEntity

@synthesize currentZ;
@synthesize currentZMapIndex;
@synthesize unshiftX;
@synthesize unshiftY;
@synthesize existedTurn;
@synthesize hit;

-(id) initWithType:(TroopTypes)troopType
{
	type = troopType;
	existedTurn = STRIGHT;
    
	NSString* troopFrameName;
	
	switch (type)
	{
		case TroopType1:
			troopFrameName = @"troopAnimIdle1.png";
			break;
		case TroopType2:
			troopFrameName = @"troopAnimIdle2.png";
			break;
            
		default:
			[NSException exceptionWithName:@"EnemyEntity Exception" reason:@"unhandled enemy type" userInfo:nil];
	}
    
	if ((self = [super initWithSpriteFrameName:troopFrameName]))
	{
		self.visible = NO;
        self.anchorPoint = ccp(0.5f, 0);
        self.hit = NO;
	}
	
	return self;
}

+(id) troopWithType:(TroopTypes)troopType
{
	return [[[self alloc] initWithType:troopType] autorelease];
}


-(void) dealloc
{
	[super dealloc];
}

@end
